<template>
    <div>
        <el-input v-model="tableId"></el-input>
        <el-button @click="deleteTable">点击删除桌台</el-button>
    </div>
</template>


<script>
export default {
    data(){
        return{
            tableId:null
        }
    },
    methods:{
        deleteTable(){
            //添加桌台
            let url = this.$store.state.globalSettings.apiUrl+`/tables/${this.tableId}`;
            //删除对应id的桌台
            this.axios.delete(url).then(res=>{
                if(res.data.code==200){
                    alert('删除成功')
                }else{
                    alert('不存在的id')
                }
            })
        }
    }
}
</script>